package com.easyOrder.web.action2.branch;

import com.easyOrder.core.comm.BaseAction;
import com.easyOrder.core.utils.WebUtils;
import com.easyOrder.dto.BranchDTO;
import com.easyOrder.model.Branch;
import com.easyOrder.service.branch.BranchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by liutao on 2017/8/4.
 */
@RestController
@RequestMapping("/branch")
public class BranchAction extends BaseAction{

    @Autowired
    private BranchService branchService;

    @RequestMapping(value = "/find", method = {RequestMethod.GET, RequestMethod.OPTIONS})
    public Object findBranch() {
        List<BranchDTO> branchDTOS = branchService.findBranch();
        return wrapperJsonView(branchDTOS);
    }
}
